#ifndef GEOMETRY_H_
#define GEOMETRY_H_

#include "math/math.h"

namespace physicsworks {

using math::vec3;

struct EdgeRef {
	vec3* v0;
	vec3* v1;
};

struct FaceRef {
	void minMaxVerts(vec3* min, vec3* max) const;
	
	vec3* v0;
	vec3* v1;
	vec3* v2;
	EdgeRef* e0;
	EdgeRef* e1;
	EdgeRef* e2;
	vec3* normal;
};

struct Geometry {
	Geometry(vec3* vertices, int numVertices, const int* verticesIndices, int numFaces);
	~Geometry() {
		delete [] vertices;
		//delete [] edges;
		delete [] faces;
		delete [] normals;
	}
	
	vec3* vertices;
	int numVertices;
	EdgeRef* edges;
	int numEdges;
	FaceRef* faces;
	int numFaces;
	vec3* normals;
	int numNormals;
};

}

#endif /*GEOMETRY_H_*/
